package com.itheima.mapper;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    @Select("select * from user")
    List<User> findAll();
    @Insert("insert into user values(id,#{username},#{password},#{sex},#{age},#{email})")
    void add(User user);

    void delete(Integer[] ids);
    @Select("select * from user where id=#{id}")
    User findById(int uid);

    @Update("update user set username=#{username},password=#{password},sex=#{sex},age=#{age},email=#{email} where id=#{id}")
    void update(User user);
}
